package com.controller;

import com.dove.feign.DeptFeignService;
import com.dove.pojo.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class ConsumerController {
    @Autowired
    @Qualifier(value = "RestTemplate2")
    private DeptFeignService deptFeignService=null;

    @RequestMapping("/consumer/add")
    public boolean add(Dept dept) {
        return this.deptFeignService.add(dept);
    }

    @RequestMapping("/consumer/get/{id}")
    public Dept get(@PathVariable("id") Long id) {
        return this.deptFeignService.get(id);
    }

    @RequestMapping("/consumer/list")
    public List<Dept> queryAll() {
        return this.deptFeignService.queryAll();
    }
}
